{{csrf_field()}}
<div class="layui-row">
    <div class="layui-col-md9">
        <div class="layui-form-item">
            <label for="" class="layui-form-label">标题：</label>
            <div class="layui-input-block">
                <input type="text" name="title" value="{{ $dao->title ?? old('title') }}" lay-verify="required" placeholder="请输入文章标题" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">选择栏目：</label>
            <div class="layui-input-inline">
                <select name="type_id"  id="type_id" >
                    <option value="">请选择栏目</option>
                    @if(isset($tree) && $tree)
                        @foreach($tree as $key=>$val)
                            @if(isset($dao) && $dao->type_id == $val['id'])
                                <option value="{{$val['id']}}" selected >{!! str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', intval($val['lv'])) !!} {{$val['name']}}</option>
                            @else
                                <option value="{{$val['id']}}" >{!! str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', intval($val['lv'])) !!}{{$val['name']}}</option>
                            @endif
                        @endforeach
                    @endif
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">请选择栏目</div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">文章摘要：</label>
            <div class="layui-input-block">
                <input type="text" name="abstract" value="{{ $dao->abstract ?? old('abstract') }}" placeholder="请输入文章摘要" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">原创作者：</label>
            <div class="layui-input-inline">
                <input type="text" name="author" value="{{ $dao->author ?? old('author') }}" placeholder="请输入原创作者" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">原创平台：</label>
            <div class="layui-input-inline">
                <input type="text" name="source" value="{{ $dao->source ?? old('source') }}" placeholder="请输入原创平台" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">跳转链接：</label>
            <div class="layui-input-block">
                <input type="text" name="jump" value="{{$dao->jump??old('jump')}}"  placeholder="请输入URL外链" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">视频地址：</label>
            <div class="layui-input-block">
                <input type="text" name="video" value="{{$dao->video ?? old('video')}}"  placeholder="请输入视频地址" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">tag标签：</label>
            <div class="layui-input-block">
                <input type="text" name="tag" value="{{$dao->tag ?? ''}}"  placeholder="请输入标签" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
                <input type="hidden" name="coin" value="{{ $dao->coin ?? 0}}" placeholder="" class="layui-input" >
            <label for="" class="layui-form-label">点击量：</label>
            <div class="layui-input-inline">
                <input type="text" name="click" value="{{ $dao->click ?? 0}}" placeholder="" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">发布时间：</label>
            <div class="layui-input-inline">
                <input type="text" name="date" value="{{$dao->date ?? date('Y-m-d H:i:s')}}"   placeholder="" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label for="" class="layui-form-label">内容：</label>
            <div class="layui-input-block">
                @component('admin.kindeditor',['name'=>'content','content'=>$dao->content ?? ""])
                @endcomponent
            </div>
        </div>
    </div>
    <div class="layui-col-md3">
        <div class="layui-form-item">
            <div class="layui-input-block">
                <div class="layui-upload-drag" id="test1" onmousemove="tips()" style="padding:15px; height: 150px">
                    @if(isset($dao->cover))
                        <img class="layui-upload-img" style="width: 100%;height: 100%" src="{{$dao->cover}}" id="demo1">
                        <input type="hidden" value="{{$dao->cover}}" name="cover">
                    @else
                        <div style="padding-top: 40px;">
                            <i class="layui-icon" style="margin-top: 60px;"></i>
                            <p>点击上传封面图片</p>
                        </div>
                    @endif
                </div>
            </div>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-input-block">
        <button type="submit" class="layui-btn" lay-submit="" lay-filter="postForm">确 认</button>
        <a  class="layui-btn" href="javascript:history.go(-1)"  >返 回</a>
    </div>
</div>